//
//  IMUserMessage.m
//  IMChezhil
//
//  Created by zhangliucheng on 15/7/8.
//  Copyright (c) 2015年 CheZhil. All rights reserved.
//

#import "IMUserMessage.h"
#import "IMCore.h"

@implementation IMUserMessage

- (instancetype)initWithMessageId:(NSString *)msgId messageType:(IMMessageType)msgType messageDirection:(IMMessageDirection)msgDirection {
    self = [super init];
    if (self) {
        self.userId = [[IMCore shareInstance] getUin];
        self.createdTime = [[NSDate date] timeIntervalSince1970]*1000;
        self.messageId = msgId;
        self.messageType = msgType;
        self.messageDirection = msgDirection;
    }
    return self;
}

- (BOOL)isEqual:(id)object {
    if (![object isKindOfClass:[self class]]) {
        return NO;
    }
    IMUserMessage *dest = object;
    return [self.messageId isEqualToString:dest.messageId];
}

- (void)markReadStatus {
    self.readStatus = ReadStatusYes;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {

}

- (id)valueForUndefinedKey:(NSString *)key {
    return [NSNull null];
}
@end
